﻿using BarManager.Core.DomainModel;
using BarManager.Core.DomainService;
using BarManager.Core.Entity;
using System;
using System.Collections.Generic;
using System.Data.Entity;
using System.Linq;
using System.Linq.Expressions;

namespace BarManager.Infrastructure.Data.Repository
{
    public class ProductoRepository : BaseRepository<Producto>, IProductoRepository
    {      
        public ProductoRepository(IObjectContext context)
            : base(context)
        {           

        }

        public override Producto Get(Expression<Func<Producto, bool>> condition)
        {
            return base.Context.Query<Producto>()
                .Include(x => x.Categoria)
                .FirstOrDefault(condition);
        }

       
    }
}
